package com.nbsaas.boot.shop.rest.resource;

import com.nbsaas.boot.shop.api.apis.ShopAppPageApi;
import com.nbsaas.boot.shop.data.entity.ShopAppPage;
import com.nbsaas.boot.shop.api.domain.request.ShopAppPageRequest;
import com.nbsaas.boot.shop.api.domain.response.ShopAppPageResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopAppPageSimple;
import com.nbsaas.boot.shop.rest.convert.ShopAppPageSimpleConvert;
import com.nbsaas.boot.shop.rest.convert.ShopAppPageEntityConvert;
import com.nbsaas.boot.shop.rest.convert.ShopAppPageResponseConvert;
import com.nbsaas.boot.shop.data.repository.ShopAppPageRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class ShopAppPageResource extends BaseResource<ShopAppPage,ShopAppPageResponse, ShopAppPageSimple, ShopAppPageRequest>  implements ShopAppPageApi {

    @Resource
    private ShopAppPageRepository shopAppPageRepository;

    @Override
    public JpaRepositoryImplementation<ShopAppPage, Serializable> getJpaRepository() {
        return shopAppPageRepository;
    }

    @Override
    public Function<ShopAppPage, ShopAppPageSimple> getConvertSimple() {
        return new ShopAppPageSimpleConvert();
    }

    @Override
    public Function<ShopAppPageRequest, ShopAppPage> getConvertForm() {
        return new ShopAppPageEntityConvert();
    }

    @Override
    public Function<ShopAppPage, ShopAppPageResponse> getConvertResponse() {
        return new ShopAppPageResponseConvert();
    }




}


